const ApolloBoost = require('apollo-boost');
const fetch = require('node-fetch')
const {
    createHttpLink
} = require('apollo-link-http');
const {
    ApolloClient,
    InMemoryCache
} = ApolloBoost;
const gql = require('graphql-tag')
const client = new ApolloClient({
    link: createHttpLink({
        uri: 'http://www.optictimesolt.com/graphql',
        fetch: fetch
    }),
    cache: new InMemoryCache()
})
let query = gql `query verify($token:String) {
    verify(token:$token)
}`
let mutation = gql `mutation Authorize_create($params:AuthorizeInput){
    Authorize_create(params:$params)
  }`
  let variables={
    id:"01EJG0CKKYGG55XN4C0NV5F3GS",
    name:"fff12",
    email:"ddsfsdf@fd.com",
    companyURL:"fddfdf",
    telephone:"12371",
    address:"dfsdsdsdsds",
    users:100,
    years:1
  }
// client.query({
//     query,
//     variables:{
//         token: '432432432423'
//     }
// }).then((res) => {
//     console.log(res.data)
// })

client.mutate({
    mutation,
    variables:{
        params:variables
    }
}).then(res => {
    console.log(res);
})